package com.demo.gulimall.seckill.entity;

import java.util.Date;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.io.Serializable;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * 优惠券领取历史记录
 *
 * @author Chen Yuan
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sms_coupon_history")
public class CouponHistory implements Serializable {
	/** id */
	@TableId(type = IdType.ID_WORKER) // 老版本
    //@TableId(type = IdType.ASSIGN_ID) // 新版本
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`id`")
	private Long id;

	/** 优惠券id */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`coupon_id`")
	private Long couponId;

	/** 会员id */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`member_id`")
	private Long memberId;

	/** 会员名字 */
	@TableField(value = "`member_nick_name`")
	private String memberNickName;

	/** 获取方式[0->后台赠送；1->主动领取] */
	@TableField(value = "`get_type`")
	private Byte getType;

	/** 创建时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
	@TableField(value = "`create_time`")
	private Date createTime;

	/** 使用状态[0->未使用；1->已使用；2->已过期] */
	@TableField(value = "`use_type`")
	private Byte useType;

	/** 使用时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
	@TableField(value = "`use_time`")
	private Date useTime;

	/** 订单id */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`order_id`")
	private Long orderId;

	/** 订单号 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`order_sn`")
	private Long orderSn;

}
